package com.filetransfer.view.Components.render;
import javax.swing.*;
import javax.swing.table.TableCellRenderer;
import java.awt.*;
public class MessageRenderer extends MessageViewButton implements TableCellRenderer {
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        String message = value != null ? value.toString() : null;
        configureButton(message);
        // 设置背景颜色
        if (isSelected) {
            setBackground(table.getSelectionBackground());
        } else {
            setBackground(table.getBackground());
        }
        return this;
    }
}
